<!--#INCLUDE FILE="config.asp"-->
<%
if(Session("SalesAccessLevel") <> 1 and Session("SalesAccessLevel") <> 4 ) then
	Response.Redirect("default.asp?msg=invalid")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- DATE PICKER SCRIPT -->
<link type="text/css" href="../css/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript">
	// ***** Session Timeout Warning and Redirect mReschke 2010-09-29 ***** //
function InitSessionTimer() {
    /* mReschke 2010-09-29 */
    warn_sec = <%=session.timeout%> * 60 * 1000;   	//Warning time in milliseconds
    timeout_sec = <%=session.timeout%> * 60 * 1000 + 60000;          //Actual timeout in milliseconds
    show_warning = true;
    epoch = new Date().getTime();
    CheckSessionStatus();
}
InitSessionTimer();
function CheckSessionStatus() {
    /* mReschke 2010-09-29 */
 
    //Check for session warning
    epoch2 = new Date().getTime();
     if (epoch2 > epoch + timeout_sec) {
        alert("Your session has timed out.");
        window.location.href = 'default.asp?msg=invalid_out';
    } else {
        down = setTimeout("CheckSessionStatus();", 2000);
    }
}
</script>
<script>
	$(function() {
		$( "#arrival1" ).datepicker();
		$( "#departure1" ).datepicker();
		$( "#arrival2" ).datepicker();
		$( "#departure2" ).datepicker();
	});
	</script>
  <!-- END DATE PICKER SCRIPT  ss-->
  
  <script> 
  $(document).ready(function(){
  $('ul.guest_timeline_list li:nth-child(odd)').addClass('alternate');
});
</script>

<style>
#divA
{	
	display:none;
	
}	
#button {
	width:120px;
	margin: 10px auto;
}
</style>

<!-- demo only -->

<script language="javascript"> 
function toggle() {
	var ele = document.getElementById("divA");
	var text = document.getElementById("displayText");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "+ Reprogramar Llamada/Reschedule Call";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "- Reprogramar Llamada/Reschedule Call";
	}
} 
</script>


<title>Programar Llamada / Schedule Call :: CostaBaja</title>

</head>
<body>
<%
if(request("shID") <> "") then
		scheduleID = request("shID")
	else 
		scheduleID = 0
	end if
	
	sqlstring1 = "SELECT DISTINCT Guests.*, ScheduleCall.*, ScheduleCall.GuestID as sG1 FROM ScheduleCall INNER JOIN Guests on Guests.GuestID = ScheduleCall.GuestID  WHERE ScheduleCall.ScheduceCallID = "&scheduleID
	
	set objConnect = server.createObject("ADODB.Connection")   

	objConnect.Open conStr

	set TblTemp = server.createobject("Adodb.Recordset")
	
	TblTemp.Open sqlstring1, objConnect
	
	Do Until TblTemp.EOF
		GuestId = TblTemp("sG1")
		Title = TblTemp("Title")
		Name = TblTemp("Name")
		Middle = TblTemp("Middle")
		Surname = TblTemp("Surname")
		
		Subject = TblTemp("Subject")
		Date_sh = TblTemp("Date")
		Notes = TblTemp("Notes")
		ResultCall = TblTemp("ResultCall")
		DoNotContact = TblTemp("DoNotContact")
		
	TblTemp.MoveNext
	Loop
%>
<div id="main_wrapper">
    	<div class="main_wrapper_margin">
        	
            <div class="admin_top_menu">
            <!-- #INCLUDE FILE="sales_menu.asp"--> 
           	</div>
        
    		<h1>Modificar/Reprogramar Llamada / Update/Reschedule
   		    Call: <%=Name%> <%=Surname%></h1>
         	<div class="clear"></div>
            
            <hr/>
           
         
           
           <fieldset>
           	<legend>Reprogramar Llamada/Reschedule Call</legend>
			<form action="update_schedule_call_process.asp" type="post">
            <table cellpadding="0" width="100%">
            	<input type="hidden" id="prospectID" name="prospectID" value="<%=GuestId%>" />
				<input type="hidden" id="scheID" name="scheID" value="<%=scheduleID%>" />
                <tr> <!-- ROW -->
                	<td width="33%" valign="top">
            		<label>Enunciado / Subject: </label><br />
					<input type="text" name="subject" value="<%=Subject%>"/>
  					</td>
                    <td width="33%" valign="top">
                    <label>Fecha / Date: </label><br />
                    <%=Date_sh%>
            		</td>
                    <td width="33%" valign="top">
                    <input name="callrs" type="radio" value="Left Message" />  Left Message<br />
                     <input name="callrs" type="radio" value="Need to Call Back" /> Need to Call Back<br />
                    <input name="callrs" type="radio" value="Other" /> Other<br />
                       <input name="callrs" type="radio" value="Change Status" /> Change Status          
                  
                    </td>
                </tr><!-- END ROW -->
                
                
                       <tr><!-- ROW -->
                <td colspan="2">
                <label>Notas / Notes: </label><br />
                <textarea cols="80" rows="5" name="Notes"><%=Notes%></textarea>
                </td>
                 <td width="33%" align="right" valign="bottom">	
           
                    </td>
                </tr><!-- END ROW -->
                
                
           </table>
           </fieldset>
           
           <fieldset>
           <legend><a id="displayText" href="javascript:toggle();"> + Reprogramar Llamada/Reschedule Call</a></legend>
            <div id="divA">
           <table>
                                  <tr> <!-- ROW -->
                	<td width="33%">
            		<label>Reprogramar/Reschedule</label>
  					</td>
                    <td width="33%" valign="top">
                  <label>Fecha de Reprogramar/Reschedule Date: </label>
                     <input type="text" id="arrival1" name="arrival1" value=""/>        
            </td>
			<td>
				<input type="checkbox" name="doNotCall" value="1"/> Do Not Contact
			</td>
            <td>
            </td>
                </tr><!-- END ROW -->
    <script type="text/javascript">
	$(function() {
		$(":radio[name='ResultCall'][value='<%=ResultCall%>']").attr('checked', 'checked');
		$(":radio[name='doNotCall'][value='<%=DoNotContact%>']").attr('checked', 'checked');
	});
  </script>       
    </table>
    </div>
    </fieldset>
	<div id="button">
   <input type="submit"  value="Enviar / Send"/>
    </div>
</form>
<fieldset>
   <legend>Last Reschedule Call</legend>
   <table cellpadding="0" width="100%">
   <tr>
	<th>Subject</th>
	<th>Note</th>
	<th>Date</th>
   </tr>
   <%
		sqlstring2 = "SELECT DISTINCT ScheduleCall.* FROM ScheduleCall WHERE ScheduleCall.GuestID = "&GuestId
	
	set objConnect = server.createObject("ADODB.Connection")   

	objConnect.Open conStr

	set TblTemp = server.createobject("Adodb.Recordset")
	
	TblTemp.Open sqlstring2, objConnect
	
	Do Until TblTemp.EOF		
		Subject = TblTemp("Subject")
		Date_sh = TblTemp("Date")
		Notes = TblTemp("Notes")
		ResultCall = TblTemp("ResultCall")
		DoNotContact = TblTemp("DoNotContact")
%>
	<tr align="center">
		<td><%=Subject%></td>
		<td><%=Notes%></td>
		<td><%=Date_sh%></td>
	</tr>
<%
		TblTemp.MoveNext
	Loop
	
   %>
  </table>
</fieldset>
    	</div><!-- END .main_wrapper_margin -->
	</div><!-- END #main_wrapper -->

               <!-- FOOTER -->
         <!--#INCLUDE file="sales_footer.asp"-->
         <!-- END FOOTER -->  

</body>
</html>
